package com.rfs.design.chain.test;

import com.rfs.design.chain.ProcessContext;
import com.rfs.design.chain.ProcessController;
import com.rfs.dto.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author renfushuai
 * @date 2022/8/29
 */
@Service
public class SendMsgService {
    @Autowired
    private ProcessController processController;
    public ResponseDTO<String> sendMsg(SendTaskDto sendTaskDto) {
        ProcessContext context = ProcessContext.builder()
                .code("sendMsg")
                .processModel(sendTaskDto)
                .needBreak(false)
                .response(ResponseDTO.succMsg("ok")).build();
        ProcessContext process = processController.process(context);
        return process.getResponse();
    }
}
